<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/11/23
  Time: 10:13
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width" />
    <meta name="author" content="www.lCYcode.com" />
    <meta name="robots" content="all" />
    <title>留言板</title>
    <link rel="stylesheet" href="/blog/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="/blog/layui/css/layui.css" />
    <link rel="stylesheet" href="/blog/css/master.css" />
    <link rel="stylesheet" href="/blog/css/gloable.css" />
    <link rel="stylesheet" href="/blog/css/nprogress.css" />
    <link rel="stylesheet" href="/blog/css/message.css" />
</head>
<body>
<div class="header">
</div>
<header class="gird-header">
    <div class="header-fixed">
        <div class="header-inner">
            <a href="/blog/javascript:void(0)" class="header-logo" id="logo">Mr.chen</a>
            <nav class="nav" id="nav">
                <ul>
                    <li><a href="/blog/">首页</a></li>
                    <li><a href="/blog/toView/workbench/article/article">博客</a></li>
                    <li><a href="/blog/toView/workbench/comment/comment">留言</a></li>
                    <li><a href="/blog/diary.html">日记</a></li>
                    <li><a href="/blog/link.html">友链</a></li>
                    <li><a>${sessionScope.user.username}</a></li>
                    <li><a href="/blog/toView/workbench/login/login" onClick="if(!confirm('是否确认退出？'))return false;">退出登录</a></li>
                </ul>
            </nav>
            <a href="/blog/#" class="blog-user">
                <i class="fa fa-qq"></i>
            </a>
            <a class="phone-menu">
                <i></i>
                <i></i>
                <i></i>
            </a>
        </div>
    </div>
</header>
<div class="doc-container" id="doc-container">
    <div class="container-fixed">
        <div class="container-inner">
            <section class="msg-remark">
                <h1>留言板</h1>
                <p>
                    沟通交流，拉近你我！
                </p>
            </section>
            <div class="textarea-wrap message" id="textarea-wrap">
                <form class="layui-form blog-editor" action="/blog/comment/save">
                    <div class="layui-form-item">
                        <textarea name="editorContent" lay-verify="content" id="remarkEditor" placeholder="请输入内容" class="layui-textarea layui-hide"></textarea>
                    </div>
                    <div class="layui-form-item">
                        <button onclick="refresh()" class="layui-btn" lay-submit="formLeaveMessage" lay-filter="formLeaveMessage">提交留言</button>
                    </div>
                </form>
            </div>
        </div>
        <div class="f-cb"></div>
        <div class="mt20">
            <ul class="message-list" id="message-list">
<%--                <li class="zoomIn article">--%>
<%--                    <div class="comment-parent">--%>
<%--                        <a name="remark-1"></a>--%>
<%--                        <img src="http://qzapp.qlogo.cn/qzapp/101871412/EE7AAE629D162B783C00149B4EDE3502/100" />--%>
<%--                        <div class="info">--%>
<%--                            <span class="username">冰</span>--%>
<%--                        </div>--%>
<%--                        <div class="comment-content">--%>
<%--                            大哥带一下--%>
<%--                        </div>--%>
<%--                        <p class="info info-footer">--%>
<%--                            <i class="fa fa-map-marker" aria-hidden="true"></i>--%>
<%--                            <span>深圳</span>--%>
<%--                            <span class="comment-time">2020-07-01</span>--%>
<%--                            <a href="/blog/javascript:;" class="btn-reply" data-targetid="1" data-targetname="冰">回复</a>--%>
<%--                        </p>--%>
<%--                    </div>--%>
<%--                    <hr />--%>
<%--                    <div class="comment-child">--%>
<%--                        <a name="reply-1"></a>--%>
<%--                        <img src="http://www.lCYcode.com/uploads/userup/57/myface.png">--%>
<%--                        <div class="info">--%>
<%--                            <span class="username">小刘</span>--%>
<%--                            <span style="padding-right:0;margin-left:-5px;">回复</span>--%>
<%--                            <span class="username">冰</span>--%>
<%--                            <span>哈哈哈哈哈哈哈哈哈哈或或或或或或或或或或或或或或或</span>--%>
<%--                        </div>--%>
<%--                        <p class="info">--%>
<%--                            <i class="fa fa-map-marker" aria-hidden="true"></i>--%>
<%--                            <span>深圳</span>--%>
<%--                            <span class="comment-time">2018-01-01</span>--%>
<%--                            <a href="/blog/javascript:;" class="btn-reply" data-targetid="2" data-targetname="小刘">回复</a>--%>
<%--                        </p>--%>
<%--                    </div>--%>
<%--                    <div class="replycontainer layui-hide">--%>
<%--                        <form class="layui-form" action="">--%>
<%--                            <input type="hidden" name="remarkId" value="1">--%>
<%--                            <input type="hidden" name="targetUserId" value="0">--%>
<%--                            <div class="layui-form-item">--%>
<%--                                <textarea name="replyContent" lay-verify="replyContent" placeholder="请输入回复内容" class="layui-textarea" style="min-height:80px;"></textarea>--%>
<%--                            </div>--%>
<%--                            <div class="layui-form-item">--%>
<%--                                <button class="layui-btn layui-btn-xs" lay-submit="formReply" lay-filter="formReply">提交</button>--%>
<%--                            </div>--%>
<%--                        </form>--%>
<%--                    </div>--%>
<%--                </li>--%>
            </ul>
        </div>
    </div>
</div>
<footer class="grid-footer">
    <div class="footer-fixed">
        <div class="copyright">
            <div class="info">
                <div class="contact">
                    <a href="/blog/javascript:void(0)" class="github" target="_blank"><i class="fa fa-github"></i></a>
                    <a href="/blog/#" class="qq" target="_blank" ><i class="fa fa-qq"></i></a>
                    <a href="/blog/#" class="email" target="_blank" ><i class="fa fa-envelope"></i></a>
                    <a href="/blog/javascript:void(0)" class="weixin"><i class="fa fa-weixin"></i></a>
                </div>
                <p class="mt05">
                    Copyright &copy; 2019-2020 CY博客 All Rights Reserved V.3.1.3 Power by CY博客
                </p>
            </div>
        </div>
    </div>
</footer>
<script src="/blog/js/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/blog/js/html5shiv.min.js" type="text/javascript"></script>
<script src="/blog/js/respond.min.js" type="text/javascript"></script>
<script src="/blog/js/selectivizr-min.js" type="text/javascript"></script>
<script src="layui/layui.js"></script>
<script src="js/yss/gloable.js"></script>
<script src="js/plugins/nprogress.js"></script>
<script src="js/yss/article.js"></script>
<%--layui--%>
<script src="/blog/js/layer-3.5.1/layer.js" type="text/javascript"></script>
<%--<link href="/blog/layui/css/layui.css" rel="stylesheet" type="text/css" />--%>
<script src="/blog/js/jquery/jquery-2.1.1.min.js"></script>

<script src="/blog/layui/layui.js" type="text/javascript"></script>
<%--<script src="/blog/js/jquery-1.11.1.min.js" type="text/javascript"></script>--%>
<%--<script src="/blog/js/html5shiv.min.js" type="text/javascript"></script>--%>
<%--<script src="/blog/js/respond.min.js" type="text/javascript"></script>--%>
<%--<script src="/blog/js/selectivizr-min.js" type="text/javascript"></script>--%>
<%--<script src="/blog/layui/layui.js"></script>--%>
<%--<script src="/blog/js/yss/gloable.js"></script>--%>
<script src="/blog/js/plugins/nprogress.js"></script>
<script>NProgress.start();</script>
<script src="/blog/js/pagemessage.js"></script>
<script>NProgress.start();</script>
<script>
    window.onload = function () {
        refresh();
        NProgress.done();
    };
    function refresh() {
        $.post("/blog/comment/allList", {

        },function (data) {
            //清空原来的内容
            $('#message-list').html("");
            //List<Comment>
            var comments = data;
            console.log(comments.length)
            for (var i = 0; i < comments.length; i++) {
                var comment = comments[i];
                    $('#message-list').append(
                        "<li class=\"zoomIn article\">"+
                        "<div class=\"comment-parent\">"+
                    "<a name=\"remark-1\"></a>"+
                    "<img src=\"http://qzapp.qlogo.cn/qzapp/101871412/EE7AAE629D162B783C00149B4EDE3502/100\" alt=\"{{name}}\" />"+
                    "<div class=\"info\">"+
                    "<span class=\"username\">"+comment.username+"</span>"+
                    "</div>"+
                    "<div class=\"comment-content\">"+
                    comment.content+
                    "</div>"+
                    " <p class=\"info info-footer\">"+
                    " <i class=\"fa fa-map-marker\" aria-hidden=\"true\"></i>"+
                    " <span class=\"comment-time\">"+comment.create_time+"</span>"+
                    "</p>"+
                    "</li>");
                }
        }, 'json');
    }
</script>
</body>
</html>

